Skip to content

fix(steer): keep a quick follow-up message from vanishing#3013

Merged
charlesvien merged 2 commits into
mainfrom
fix/steer-echo-clears-pending-messages
Jun 30, 2026
Merged

fix(steer): keep a quick follow-up message from vanishing#3013
charlesvien merged 2 commits into
mainfrom
fix/steer-echo-clears-pending-messages

Conversation

@charlesvien

Copy link
Copy Markdown
Member

Problem

Reported by a user using Steer. With a task in Queue mode, sending one message then switching to Steer steers that message correctly. But a second message sent in the brief window right after the switch is lost: it renders for a moment, then disappears from the chat once the first message is brought into context.

Changes

Root cause: every session/prompt echo was routed through replaceOptimisticWithEvent, which clears all of a session's optimistic placeholders. A steer carries no optimistic placeholder of its own (sendSteerPrompt skips applyOptimisticPrompt), so when the first message's steer echo arrived it wiped the second message's still-pending placeholder, making it vanish until its own echo landed.

Now a steer echo is appended instead of replacing, so it renders without disturbing other in-flight placeholders. Normal prompt echoes still replace their placeholder as before.

How did you test this?

  • Added steer echo routing tests in sessionServiceHost.test.ts: a steer echo appends without clearing pending optimistic placeholders, and a normal prompt echo still replaces its own placeholder. Confirmed the new steer test fails against the pre-fix code.
  • Ran locally, all green:
    • @posthog/ui unit suite (1039 tests)
    • @posthog/core unit suite (1788 tests)
    • pnpm typecheck (all packages)
    • Biome check on the changed files

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit b28def9.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "keep steer echo from clearing pending me..." | Re-trigger Greptile

Comment thread packages/ui/src/features/sessions/sessionServiceHost.test.ts
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jun 30, 2026
github-actions[bot]
github-actions Bot previously approved these changes Jun 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeted, well-commented bug fix that adds an extra guard to prevent steer message echoes from replacing unrelated optimistic placeholders. Uses an existing, well-tested isSteerMessage method and adds clear coverage for both paths. The resolved bot comment is a style suggestion only.

@github-actions github-actions Bot dismissed their stale review June 30, 2026 07:29

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-line guard using an existing method, well-tested with both paths covered. The resolved style comment was actually adopted (tests use it.each). No showstoppers.

@charlesvien charlesvien merged commit c9e0b25 into main Jun 30, 2026
23 checks passed
@charlesvien charlesvien deleted the fix/steer-echo-clears-pending-messages branch June 30, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant